package com.springboot.example.monitor.dao.impl;

import com.springboot.example.monitor.dao.StateDao;
import com.springboot.example.monitor.mapper.StateMapper;
import com.springboot.example.monitor.domain.db.State;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * State
 * <p/>
 * User: guoyao
 * DateTime: 2016-02-23 16:23:51
 */
@Service("stateDao")
public class StateDaoImpl implements StateDao {

    @Resource
    private StateMapper stateMapper;

    /**
     * 根据主键查询State对象
     *
     * @param stateId
     * @return State对象
     */
    @Override
    public State selectByPrimaryKey(Long stateId) {
        return stateMapper.selectByPrimaryKey(stateId);
    }

    /**
     * 根据查询条件查询符合条件的State对象
     *
     * @param state
     * @return 符合条件的State对象List
     */
    @Override
    public List<State> select(State state) {
        return stateMapper.select(state);
    }

    /**
     * 根据主键删除State对象
     *
     * @param stateId
     * @return 影响条件数
     */
    @Override
    public int deleteByPrimaryKey(Long stateId) {
        return stateMapper.deleteByPrimaryKey(stateId);
    }

    /**
     * 根据条件删除符合条件的State对象
     *
     * @param state
     * @return 影响条件数
     */
    @Override
    public int delete(State state) {
        return stateMapper.delete(state);
    }

    /**
     * 插入State对象
     *
     * @param state
     * @return 影响条件数
     */
    @Override
    public int insert(State state) {
        return stateMapper.insert(state);
    }

    /**
     * 更新State对象
     *
     * @param state
     * @return 影响条件数
     */
    @Override
    public int update(State state) {
        return stateMapper.update(state);
    }
}
